Skip to content

E2E framework plus tests#3829

Draft
joe-ayoub-segment wants to merge 225 commits into
mainfrom
e2e-framework-plus-tests
Draft

E2E framework plus tests#3829
joe-ayoub-segment wants to merge 225 commits into
mainfrom
e2e-framework-plus-tests

Conversation

@joe-ayoub-segment

Copy link
Copy Markdown
Contributor

⚠️ Not intended to be merged into main

This is a staging/integration branch, not a merge candidate. It exists so that end-to-end (e2e) tests can be authored for in-flight PRs before the e2e framework itself lands on main. Treat it as a working surface for e2e test development, not a feature PR.

Do not merge this into main. The underlying feature work lives in its own individual PRs (linked below), which go through the normal review/merge process on their own.

What's in this branch

Branched from feat/e2e-test-types-and-fixtures (the e2e framework PR #3817), with the following feature branches merged in to provide the destination code the e2e tests need to exercise:

  • pinterest-new-events
  • customerio-msresponse
  • iterable-subscription-management
  • hubspot-oauth-upgrade
  • iterable-update-email
  • mixpanel-secret-deprecation
  • rokt-capi-bug
  • linkedin-new-identifiers
  • braze-ecommerce-addtocart
  • s3-shah256-support
  • fb-appendvalue
  • gec-journeys2-support
  • feat/braze-merge-users

One merge conflict was resolved (braze/index.ts — Track Calls preset subscribe filter, kept the superset that excludes Product Added/Product Removed, consistent with the dedicated presets those branches add).

e2e tests added

google-enhanced-conversions (first destination):

  • Added createE2EJourneysV2AudienceEvent helper + supporting types to the e2e framework (packages/core/src/e2e-helpers.ts, e2e-types.ts), exported from @segment/actions-core. This models the Journeys V2 event shape (computation_class: 'journey_step', journey_context / journey_metadata) introduced by gec-journeys2-support.
  • Added userList/e2e/journeysV2.e2e.ts fixtures (single add, single add with explicit mirror sync mode, batch add) — covering the Journeys V2 path that the existing Engage / JourneysV1 / RETL fixtures did not.

This fills the one e2e coverage gap for g-e-c: the prior fixtures covered Engage, JourneysV1, and RETL, but not the new Journeys V2 support.

Notes

  • Verified: core builds clean, cloud typechecks clean against the new helper/types, and the helper emits the exact journey_step event shape used by gec-journeys2-support's unit tests.
  • Only google-enhanced-conversions e2e tests are included in this branch; e2e tests for the other merged destinations are intentionally out of scope here.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

joe-ayoub-segment and others added 2 commits July 6, 2026 15:20
Cover single subscribe/unsubscribe (by email and by userId), batch bulk
subscribe with per-item multistatus, and the client-side validation paths
(missing identifier, >6 items, differing subscriptions in a batch). Group IDs
are read from env (E2E_ITERABLE_MESSAGE_CHANNEL_ID / _MESSAGE_TYPE_ID /
_EMAIL_LIST_ID) rather than hardcoded; document all required env vars in the
destination's __e2e__/index.ts.

The /api/subscriptions/{group}/{id}/... endpoints are gated per Iterable
project and must be enabled by Iterable, so the HTTP fixtures fail with a 404
"Endpoint not found for project" until that is done. The verboseFailureHint on
those fixtures explains this so the failure is self-diagnosing.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Update the 'Batch add and remove users' e2e fixture so one user ID does
not exist in Amplitude. Verifies the valid users still succeed (200) while
the nonexistent user is returned in skipped_ids and surfaced as a per-item
400 with the correct error message.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 6, 2026 16:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Copies the LinkedIn DMP Company Segment sync action (account-based
marketing) from linkedin-company-audience-hooks (PR #3856) so we can
build e2e-framework tests against it.

- New updateCompanyAudience action + api.ts methods + index.ts registration
- Deletes the destination-level snapshot.test.ts (incompatible with
  hook-gated actions), matching the source PR.
- Intentionally omits metadata.json: this branch deliberately strips
  metadata.json from all destinations (kept only for amplitude).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 7, 2026 14:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

@joe-ayoub-segment joe-ayoub-segment force-pushed the e2e-framework-plus-tests branch from e8f851a to 09c16ef Compare July 7, 2026 15:59
Collapse duplicate company+action payloads within a batch into a single
element sent to LinkedIn (keyed on normalized domain + organization URN,
so case, whitespace, and bare-id-vs-URN forms of the same company match).
LinkedIn's per-item result is fanned back out to every original payload
index via a parallel index-list, so each input row still gets its own
MultiStatusResponse entry.

Expands the e2e duplicate fixture to interleave non-contiguous dupes,
all three normalization paths, and two invalid rows.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 7, 2026 16:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

joe-ayoub-segment and others added 2 commits July 7, 2026 18:16
Covers the same scenario as the e2e duplicate fixture: 12 input rows
collapse to 4 unique company+action elements, and each LinkedIn result
(success and error) is fanned back to every original index. Asserts the
exact request body and the full per-item response array, exercising
case/whitespace/bare-id-vs-URN normalization and interleaved no-identifier
validation failures.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…zation

Ports the fixes made on linkedin-company-audience-hooks (PR #3856):
- api.ts: add LinkedIn-Version header to the DMP segment hook endpoints
  (listDmpSegmentsByAccount, getDmpSegmentById, createCompanyDmpSegment);
  without it LinkedIn returns 400 VERSION_MISSING.
- functions.ts: treat any 2xx as success (was strict === 200); normalize
  identifiers once in validate() (trim + lowercase domain, trim id,
  whitespace-only treated as missing) so dedupe key and sent JSON agree.
- Update dedup unit test + regenerate snapshots for the normalized
  (lower-cased) domain and the 202506 version.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 8, 2026 10:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

joe-ayoub-segment and others added 2 commits July 8, 2026 12:44
Adds a batchWithMultistatus fixture that syncs 350 real company domains
to the DMP Company Segment in a single request (well under LinkedIn's
5000-per-batch max), asserting a 201 for every row.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Ports from amplitudecohorts-fixes: clearer user_id field description
(temporary seed user, automatic discovery, manual only as fallback) and
narrows CreateAudienceJSON.id_type to 'BY_USER_ID' (the only supported
value when creating a cohort).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 8, 2026 13:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Adds coverage for the previously-untested hook error/edge paths:
- create segment returns 201 but no x-restli-id -> CREATE_SEGMENT_FAILURE
- create segment request throws -> error result, no savedData
- fetch existing segment throws -> error result, no savedData
- getCompanyAudiences (dropdown) throws -> empty choices + error
- companyAudienceHook.performHook wrapper: delegates to performCompanyHook
  and defaults hookInputs to {} when undefined

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 8, 2026 15:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Renames the columns_to_hash field to columns_to_transform and lets each
column select a hash_algorithm ('none' or 'sha256') and a normalize mode
('none' | 'lowercase' | 'trim' | 'lowercase_trim'), both defaulting to
'none'. Normalization runs before hashing via processHashing's cleaning
function, so already-hashed values are never normalized; hash_algorithm
'none' normalizes without hashing. All gated behind the existing
actions-s3-hashing flag.

- Extract SUPPORTED_HASH_ALGORITHMS / SUPPORTED_NORMALIZATIONS to
  constants.ts; generate field choices from them.
- Lock the choice sub-fields to dropdown/typed input only
  (disabledInputMethods).
- Unit tests for every normalize mode, normalize-then-hash, hash with
  normalize none, already-hashed skip, and resolveColumnTransforms
  validation; e2e fixtures for normalize-then-hash and normalize-only.

Verified end-to-end against the real S3 bucket: recomputed every SHA256
and confirmed normalize-only writes transformed plaintext.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 9, 2026 11:12

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Ports the copilot-comment fix from s3-shah256-support: the normalize
field said "Already-hashed values are never normalized", which is
inaccurate for the normalize-only path. Corrected to "Values that are
already hashed are never re-hashed" (the guarantee processHashing
actually provides).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 9, 2026 15:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of lines (20,000). Try reducing the number of changed lines and requesting a review from Copilot again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants